package demo2;

interface USB {
    void openDevice();

    void closeDevice();
}

class Mouse implements USB {
    @Override
    public void openDevice() {
        System.out.println("打开鼠标服务");
    }

    @Override
    public void closeDevice() {
        System.out.println("关闭鼠标服务");
    }
}

class keyBoard implements USB {
    @Override
    public void openDevice() {
        System.out.println("打开键盘服务");
    }

    @Override
    public void closeDevice() {
        System.out.println("关闭键盘服务");
    }
}

public class computer {
    keyBoard keyboard = new keyBoard();
    Mouse mouse = new Mouse();

    public static void open(USB usb) {
        usb.openDevice();
    }

    public static void close(USB usb) {
        usb.closeDevice();
    }

    public static void main(String[] args) {
        open(new keyBoard());
        open(new Mouse());
        System.out.println("====================");
        close(new keyBoard());
        close(new Mouse());
    }
}
